{include file="public/layout" /}
<body class="laytp-container">
<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">可提现金额</label>
            <div class="layui-input-inline layui-input-wrap">
                {$supply['s_money']}
            </div>
            <div class="layui-form-mid layui-text-em">多个日期使用英文逗号分割，例：每月1、2号可提现，填写1,2</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">提现金额</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="money" lay-verify="required" value="" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">提现方式</label>
            <div class="layui-input-inline layui-input-wrap" style="width: 300px;">
<!--                <input type="radio" name="dz_type" value="wechat"  title="微信">-->
<!--                <input type="radio" name="dz_type" value="alipay"  title="支付宝">-->
                <input type="radio" name="dz_type" value="bank"  title="银行卡">
            </div>
            <div class="layui-form-mid layui-text-em"></div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">确认</button>
            </div>
        </div>
    </form>
    </div>
</div>
<script>
    layui.use(function(){
        var form = layui.form;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var util = layui.util;

        // 自定义验证规则
        form.verify({
            pass: [
                /^[\S]{6,12}$/,
                '密码必须6到12位，且不能出现空格'
            ]
        });
        // 提交事件
        form.on('submit(demo1)', function(data){
            var index = layer.load();
            layer.close(index);

            var field = data.field; // 获取表单字段值
            $.ajax({
                type: "POST",
                url: "{:url('withdraw')}",
                data: field,
                success: function(res){
                    console.log(res);
                    if(res.status){
                        layer.msg('提交成功');
                    }else{
                        layer.msg(res.msg);
                    }
                }
            });
            return false; // 阻止默认 form 跳转
        });

        // 日期
        laydate.render({
            elem: '#date'
        });


    });
</script>
</body>
</html>